home *** CD-ROM | disk | FTP | other *** search
/ C++ für Kids / C++ for kids.iso / SETUP / US / CBUILDER / DATA.Z / GLU.H < prev    next >
C/C++ Source or Header  |  1997-02-13  |  11KB  |  265 lines

  1. /*++ BUILD Version: 0004    // Increment this if a change has global effects
  2.  
  3. Module Name:
  4.  
  5.     glu.h
  6.  
  7. Abstract:
  8.  
  9.     Procedure declarations, constant definitions and macros for the OpenGL
  10.     Utility Library.
  11.  
  12. --*/
  13.  
  14. /*
  15.  *      C/C++ Run Time Library - Version 8.0
  16.  *
  17.  *      Copyright (c) 1994, 1997 by Borland International
  18.  *      All Rights Reserved.
  19.  *
  20.  */
  21.  
  22. #ifndef __GLU_H__
  23. #define __GLU_H__
  24. #define __GLU_H
  25. #pragma option -b
  26.  
  27. /*
  28. ** Copyright 1991-1993, Silicon Graphics, Inc.
  29. ** All Rights Reserved.
  30. ** 
  31. ** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  32. ** the contents of this file may not be disclosed to third parties, copied or
  33. ** duplicated in any form, in whole or in part, without the prior written
  34. ** permission of Silicon Graphics, Inc.
  35. ** 
  36. ** RESTRICTED RIGHTS LEGEND:
  37. ** Use, duplication or disclosure by the Government is subject to restrictions
  38. ** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  39. ** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  40. ** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  41. ** rights reserved under the Copyright Laws of the United States.
  42. */
  43.  
  44. #pragma option -b.
  45. #include <GL/gl.h>
  46. #pragma option -b
  47.  
  48. #ifdef __cplusplus
  49. extern "C" {
  50. #endif
  51.  
  52. /*
  53. ** Return the error string associated with a particular error code.
  54. ** This will return 0 for an invalid error code.
  55. **
  56. ** The generic function prototype that can be compiled for ANSI or Unicode
  57. ** is defined as follows:
  58. **
  59. ** LPCTSTR APIENTRY gluErrorStringWIN (GLenum errCode);
  60. */
  61. #ifdef UNICODE
  62. #define gluErrorStringWIN(errCode) ((LPCSTR)  gluErrorUnicodeStringEXT(errCode))
  63. #else
  64. #define gluErrorStringWIN(errCode) ((LPCWSTR) gluErrorString(errCode))
  65. #endif
  66. const GLubyte* APIENTRY gluErrorString (GLenum errCode);
  67. const wchar_t* APIENTRY gluErrorUnicodeStringEXT (GLenum errCode);
  68.  
  69. void APIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
  70. void APIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
  71. void APIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble width, GLdouble height, GLint viewport[4]);
  72. void APIENTRY gluLookAt (GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, GLdouble upz);
  73. int APIENTRY gluProject (GLdouble objx, GLdouble objy, GLdouble objz, const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *winx, GLdouble *winy, GLdouble *winz);
  74. int APIENTRY gluUnProject (GLdouble winx, GLdouble winy, GLdouble winz, const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *objx, GLdouble *objy, GLdouble *objz);
  75.  
  76. int APIENTRY gluScaleImage (GLenum format, GLint widthin, GLint heightin, GLenum typein, const void *datain, GLint widthout, GLint heightout, GLenum typeout, void *dataout);
  77.  
  78. int APIENTRY gluBuild1DMipmaps (GLenum target, GLint components, GLint width, GLenum format, GLenum type, const void *data);
  79. int APIENTRY gluBuild2DMipmaps (GLenum target, GLint components, GLint width, GLint height, GLenum format, GLenum type, const void *data);
  80.  
  81. typedef struct GLUquadricObj GLUquadricObj;
  82. GLUquadricObj* APIENTRY gluNewQuadric (void);
  83. void APIENTRY gluDeleteQuadric (GLUquadricObj *state);
  84. void APIENTRY gluQuadricNormals (GLUquadricObj *quadObject, GLenum normals);
  85. void APIENTRY gluQuadricTexture (GLUquadricObj *quadObject, GLboolean textureCoords);
  86. void APIENTRY gluQuadricOrientation (GLUquadricObj *quadObject, GLenum orientation);
  87. void APIENTRY gluQuadricDrawStyle (GLUquadricObj *quadObject, GLenum drawStyle);
  88. void APIENTRY gluCylinder (GLUquadricObj *qobj, GLdouble baseRadius, GLdouble topRadius, GLdouble height, GLint slices, GLint stacks);
  89. void APIENTRY gluDisk (GLUquadricObj *qobj, GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops);
  90. void APIENTRY gluPartialDisk (GLUquadricObj *qobj, GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops, GLdouble startAngle, GLdouble sweepAngle);
  91. void APIENTRY gluSphere (GLUquadricObj *qobj, GLdouble radius, GLint slices, GLint stacks);
  92. void APIENTRY gluQuadricCallback (GLUquadricObj *qobj, GLenum which, void (CALLBACK* fn)());
  93.  
  94. typedef struct GLUtriangulatorObj GLUtriangulatorObj;
  95. GLUtriangulatorObj* APIENTRY gluNewTess (void);
  96. void APIENTRY gluTessCallback (GLUtriangulatorObj *tobj, GLenum which, void (CALLBACK* fn)());
  97. void APIENTRY gluDeleteTess (GLUtriangulatorObj *tobj);
  98. void APIENTRY gluBeginPolygon (GLUtriangulatorObj *tobj);
  99. void APIENTRY gluEndPolygon (GLUtriangulatorObj *tobj);
  100. void APIENTRY gluNextContour (GLUtriangulatorObj *tobj, GLenum type);
  101. void APIENTRY gluTessVertex (GLUtriangulatorObj *tobj, GLdouble v[3], void *data);
  102.  
  103. #ifdef __cplusplus
  104.     class GLUnurbsObj;
  105. #else 
  106.     typedef struct GLUnurbsObj GLUnurbsObj;
  107. #endif
  108. GLUnurbsObj* APIENTRY gluNewNurbsRenderer (void);
  109. void APIENTRY gluDeleteNurbsRenderer (GLUnurbsObj *nobj);
  110. void APIENTRY gluBeginSurface (GLUnurbsObj *nobj);
  111. void APIENTRY gluBeginCurve (GLUnurbsObj *nobj);
  112. void APIENTRY gluEndCurve (GLUnurbsObj *nobj);
  113. void APIENTRY gluEndSurface (GLUnurbsObj *nobj);
  114. void APIENTRY gluBeginTrim (GLUnurbsObj *nobj);
  115. void APIENTRY gluEndTrim (GLUnurbsObj *nobj);
  116. void APIENTRY gluPwlCurve (GLUnurbsObj *nobj, GLint count, GLfloat *array, GLint stride, GLenum type);
  117. void APIENTRY gluNurbsCurve (GLUnurbsObj *nobj, GLint nknots, GLfloat *knot, GLint stride, GLfloat *ctlarray, GLint order, GLenum type);
  118. void APIENTRY gluNurbsSurface (GLUnurbsObj *nobj, GLint sknot_count, GLfloat *sknot, GLint tknot_count, GLfloat *tknot, GLint s_stride, GLint t_stride, GLfloat *ctlarray, GLint sorder, GLint torder, GLenum type);
  119. void APIENTRY gluLoadSamplingMatrices (GLUnurbsObj *nobj, const GLfloat modelMatrix[16], const GLfloat projMatrix[16], const GLint viewport[4]);
  120. void APIENTRY gluNurbsProperty (GLUnurbsObj *nobj, GLenum property, GLfloat value);
  121. void APIENTRY gluGetNurbsProperty (GLUnurbsObj *nobj, GLenum property, GLfloat *value);
  122. void APIENTRY gluNurbsCallback (GLUnurbsObj *nobj, GLenum which, void (CALLBACK* fn)());
  123.  
  124.  
  125. /****           Callback function prototypes    ****/
  126.  
  127. /* gluQuadricCallback */
  128. typedef void (CALLBACK* GLUquadricErrorProc) (GLenum);
  129.  
  130. /* gluTessCallback */
  131. typedef void (CALLBACK* GLUtessBeginProc)    (GLenum);
  132. typedef void (CALLBACK* GLUtessEdgeFlagProc) (GLboolean);
  133. typedef void (CALLBACK* GLUtessVertexProc)   (void *);
  134. typedef void (CALLBACK* GLUtessEndProc)      (void);
  135. typedef void (CALLBACK* GLUtessErrorProc)    (GLenum);
  136.  
  137. /* gluNurbsCallback */
  138. typedef void (CALLBACK* GLUnurbsErrorProc)   (GLenum);
  139.  
  140.  
  141. /****           Generic constants               ****/
  142.  
  143. /* Errors: (return value 0 = no error) */
  144. #define GLU_INVALID_ENUM        100900
  145. #define GLU_INVALID_VALUE       100901
  146. #define GLU_OUT_OF_MEMORY       100902
  147.  
  148. /* For laughs: */
  149. #define GLU_TRUE                GL_TRUE
  150. #define GLU_FALSE               GL_FALSE
  151.  
  152.  
  153. /****           Quadric constants               ****/
  154.  
  155. /* Types of normals: */
  156. #define GLU_SMOOTH              100000
  157. #define GLU_FLAT                100001
  158. #define GLU_NONE                100002
  159.  
  160. /* DrawStyle types: */
  161. #define GLU_POINT               100010
  162. #define GLU_LINE                100011
  163. #define GLU_FILL                100012
  164. #define GLU_SILHOUETTE          100013
  165.  
  166. /* Orientation types: */
  167. #define GLU_OUTSIDE             100020
  168. #define GLU_INSIDE              100021
  169.  
  170. /* Callback types: */
  171. /*      GLU_ERROR               100103 */
  172.  
  173.  
  174. /****           Tesselation constants           ****/
  175.  
  176. /* Callback types: */
  177. #define GLU_BEGIN               100100          /* void (*)(GLenum)     */
  178. #define GLU_VERTEX              100101          /* void (*)(void *)     */
  179. #define GLU_END                 100102          /* void (*)(void)       */
  180. #define GLU_ERROR               100103          /* void (*)(GLint)      */
  181. #define GLU_EDGE_FLAG           100104          /* void (*)(GLboolean)  */
  182.  
  183. /* Contours types: */
  184. #define GLU_CW